package com.iwic.smartkidsdaycares;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class TestFragment extends Fragment {
	public static final String ARG_SECTION= "section_number";
	int halaman;
	private static String[] labels = new String[]
			{"Halaman 1","Halaman 2","Halaman 3","Halaman 4","Halaman 5","Halaman 6","Halaman 7"};
	@Override
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View rootView = inflater.inflate(R.layout.fragment_main, container,
				false);
		int bg = Color.rgb((int) Math.floor(Math.random()*128)+64, 
				(int) Math.floor(Math.random()*128)+64,
				(int) Math.floor(Math.random()*128)+64);
		halaman = getArguments().getInt(ARG_SECTION);
		TextView label = (TextView)rootView.findViewById(R.id.section_label);
		label.setText(labels[halaman]);
		rootView.setBackgroundColor(bg);
		return rootView;
	}

}
